package com.appsindy.common.action;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.SessionAware;

import com.appsindy.common.action.AppsindyBaseAction;

/**
 *
 * @author LEE
 */
public class LogoutAction extends AppsindyBaseAction implements SessionAware {
    
    private Map<String, Object> session;
    
    public LogoutAction() {
    }
    
    public String execute(){
        System.out.println("[LogoutAction.execute] Time : " + new Date());
        setSession(new HashMap<String, Object>());
        
        HttpSession httpSession = ServletActionContext.getRequest().getSession(false);
        if(httpSession != null){
        	httpSession.invalidate();
        }
        return SUCCESS;
    }
    
	public void setSession(Map<String, Object> session) {
		this.session = session;
	}
	public Map<String, Object> getSession(){
		return session;
	}
    
}
